//
//  LoginOrRegistViewController.m
//  MooreDoll
//
//  Created by 郭景豪 on 2014/12/8.
//  Copyright (c) 2014年 Tank. All rights reserved.
//

#import "LoginOrRegistViewController.h"
#import "RegistViewController.h"
#import "StartViewController.h"
#import "UserInfoSettingViewController.h"


@interface LoginOrRegistViewController ()

@end

@implementation LoginOrRegistViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //登入頁面 所以把navigationController Bar 隱藏
    [self.navigationController.navigationBar setHidden:YES];

    //檢查密碼 用來判斷是不是註冊一半就離開
    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"password"]isEqualToString:DEFAULT_PASSWORD]) {
        UserInfoSettingViewController *userInfoSettingVC = [self.storyboard instantiateViewControllerWithIdentifier:@"UserInfoSettingViewController"];
        
        [userInfoSettingVC.navigationItem setHidesBackButton:YES];
        
        [self.navigationController pushViewController:userInfoSettingVC animated:YES];
    }
    
}
-(void)viewWillAppear:(BOOL)animated
{
    [self.navigationController.navigationBar setHidden:YES];

}
-(void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController.navigationBar setHidden:NO];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

}
- (IBAction)loginButton:(id)sender {
    //選擇登入
    StartViewController *startVC=[self.storyboard instantiateViewControllerWithIdentifier:@"StartViewController"];
    [self.navigationController pushViewController:startVC animated:YES];

}
- (IBAction)RegistButton:(id)sender {
    //選擇註冊
    RegistViewController *registVC=[self.storyboard instantiateViewControllerWithIdentifier:@"RegistViewController"];
    [self.navigationController pushViewController:registVC animated:YES];

}



@end
